<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
    <head>
        <s:head theme="ajax" debug="true"/>
        <script type="text/javascript">...
            dojo.event.topic.subscribe("/save", function(data, type, request) ...{
                if(type == "load") ...{
                    dojo.byId("userid").value = "";
                    dojo.byId("username").value = "";
                    dojo.byId("password").value = "";
                    dojo.byId("groupname").value = "";
                }
            });

            dojo.event.topic.subscribe("/edit", function(data, type, request) ...{
                if(type == "before") ...{
                    var id = data.split("_")[1];
                    var tr = dojo.byId("row_"+id);
                    var tds = tr.getElementsByTagName("td");

                    dojo.byId("userid").value = id;
                    dojo.byId("username").value = dojo.string.trim(dojo.dom.textContent(tds[0]));
                    dojo.byId("password").value = dojo.string.trim(dojo.dom.textContent(tds[1]));
                    dojo.byId("groupname").value = dojo.string.trim(dojo.dom.textContent(tds[1]));
                }
            });
        </script>
    </head>
    <body>
        <s:url action="list" id="descrsUrl"/>

        <div style="width: 300px;border-style: solid">
            <div style="text-align: right;">
                <s:a theme="ajax" notifyTopics="/refresh">Refresh</s:a>
            </div>
            <s:div id="userAccounts" theme="ajax" href="%{descrsUrl}" loadingText="Loading..." listenTopics="/refresh"/>
        </div>

        <br/>

        <div style="width: 300px;border-style: solid">
            <p>userAccount Data</p>
            <s:form action="save" validate="true">
                <s:textfield id="userid" name="userAccount.userid" cssStyle="display:none"/>
                <s:textfield id="username" label="Name" name="userAccount.username"/>
                <s:textfield id="password" label="ISBN" name="userAccount.password"/>
                <s:textfield id="groupname" label="Author" name="userAccount.groupname"/>
                <s:submit theme="ajax" targets="userAccounts" notifyTopics="/save"/>
            </s:form>
        </div>
    </body>
</html>